package com.zhentao.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import lombok.Data;

/**
 *
 * @TableName order_info
 */
@TableName(value ="order_info")
@Data
public class OrderInfo implements Serializable {
    /**
     *
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 用户id
     */
    private Integer userId;

    /**
     * 总价
     */
    private BigDecimal sums;

    /**
     * 实付金额
     */
    private BigDecimal price;

    /**
     * 优惠券id
     */
    private Integer cId;

    /**
     * 优惠价
     */
    private BigDecimal cPrice;

    /**
     * 状态
     */
    private Integer statics;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        OrderInfo other = (OrderInfo) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getSums() == null ? other.getSums() == null : this.getSums().equals(other.getSums()))
            && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
            && (this.getCId() == null ? other.getCId() == null : this.getCId().equals(other.getCId()))
            && (this.getCPrice() == null ? other.getCPrice() == null : this.getCPrice().equals(other.getCPrice()))
            && (this.getStatics() == null ? other.getStatics() == null : this.getStatics().equals(other.getStatics()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getSums() == null) ? 0 : getSums().hashCode());
        result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
        result = prime * result + ((getCId() == null) ? 0 : getCId().hashCode());
        result = prime * result + ((getCPrice() == null) ? 0 : getCPrice().hashCode());
        result = prime * result + ((getStatics() == null) ? 0 : getStatics().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", userId=").append(userId);
        sb.append(", sums=").append(sums);
        sb.append(", price=").append(price);
        sb.append(", cId=").append(cId);
        sb.append(", cPrice=").append(cPrice);
        sb.append(", static=").append(statics);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}
